#include<iostream>
#define MAXN 100

using namespace std;

long binomial_coefficient(int n,int m)
{
    int i,j;                  //Counters
    long bc[MAXN][MAXN];      //Table of binomial coefficients
    
    for(i=0; i<=n; i++)
        bc[i][0] = 1;
    for(j=0; j<=n; j++)
        bc[j][j] = 1;
        
    for(i=1; i<=n; i++)
        for(j=1; j<i; j++)
            bc[i][j] = bc[i-1][j-1] + bc[i-1][j];
            
    return(bc[n][m]);
}

int main() {
   cout << binomial_coefficient(10, 5);
   return 0;
}
